#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,k,important[100005],vis[100005],u,v,cnt;
vector<int> edge[100005],ans[100005];
int dfs(int u){
	if(vis[u])return -1;
	vis[u]=1;
	int lst=(important[u]?u:-1),x;
	for(int i:edge[u]){
		x=dfs(i);
		if(x!=-1){
			if(lst==-1)lst=x;
			else cnt++,lst=-1;
		}
	}
	return lst;
}
int dfs2(int u){
	if(vis[u])return -1;
	vis[u]=1;
	int lst=(important[u]?u:-1),x;
	ans[u]=vector<int>(1,u);
	for(int i:edge[u]){
		x=dfs2(i);
		if(x!=-1){
			if(lst==-1){
				lst=x;
				ans[lst].push_back(u);
			}else{
				cout<<ans[lst].size()+ans[x].size()<<' ';
				for(int i:ans[lst])cout<<i<<' ';
				for(int i=(int)(ans[x].size())-1;i>=0;i--)cout<<ans[x][i]<<' ';
				cout<<'\n';
				ans[lst].clear();
				ans[lst].shrink_to_fit();
				ans[x].clear();
				ans[x].shrink_to_fit();
				lst=-1;
			}
		}
	}
	return lst;
}
int main(){
	ios::sync_with_stdio(0);
  	freopen("travel.in","r",stdin);
  	freopen("travel.out","w",stdout);
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		cin>>u>>v;
		edge[u].push_back(v);
		edge[v].push_back(u);
	}
	for(int i=1;i<=k;i++)cin>>u,important[u]=1;
	for(int i=1;i<=n;i++)dfs(i);
	memset(vis,0,sizeof(vis));
	cout<<cnt<<'\n';
	for(int i=1;i<=n;i++)dfs2(i);
}
